package dao;

import java.sql.Connection;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.sql.Statement;

import metier.Spectacle;

public class DaoSpectacle 
{
	static String chaine = "jdbc:mysql://localhost/";
	static Statement stLienBd = null;
	static ResultSet res = null;
	static Connection connec;
	
	

	public int AjoutSpectacle (Spectacle unSpectacle) throws ClassNotFoundException
	{
		try
		{
			connec = ConnexionMySQL.getConnection(chaine, "root", "");
			String req = "insert into spectacle values (" + unSpectacle.getNumSpect() + ", '" + unSpectacle.getNomSpect() + "' ," + unSpectacle.getDate()
					+ "" + unSpectacle.getTarif() + ")";
			System.out.println(req);
		}
		catch (SQLException sql)
		{
			System.out.println(sql.getMessage());
		}
		return 1;
	}
	
	//A faire vecteur de spectacles
	

}
